<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    
    <title>Pony 教程 </title>
    <meta name="HandheldFriendly" content="True">
    <meta name="MobileOptimized" content="320">

    <meta name="viewport" content="width=device-width,minimum-scale=1">
    <meta name="generator" content="Hugo 0.69.0-DEV" />
    
    
      <META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
    

    <style>
      @font-face {
        font-family: 'Icon';
        src: url('/pony-tutorial/dist/fonts/icon.eot?52m981');
        src: url('/pony-tutorial/dist/fonts/icon.eot?#iefix52m981')
               format('embedded-opentype'),
             url('/pony-tutorial/dist/fonts/icon.woff?52m981')
               format('woff'),
             url('/pony-tutorial/dist/fonts/icon.ttf?52m981')
               format('truetype'),
             url('/pony-tutorial/dist/fonts/icon.svg?52m981#icon')
               format('svg');
        font-weight: normal;
        font-style: normal;
      }
    </style>

    <link href="/pony-tutorial/dist/css/app.css" rel="stylesheet">
    <link href="/pony-tutorial/dist/css/highlight.css" rel="stylesheet">
    <link href="/pony-tutorial/dist/css/icon.css" rel="stylesheet">
    <link href="/pony-tutorial/dist/css/pony.css" rel="stylesheet">

    

    
      
    

    

    <meta property="og:title" content="404 Page not found" />
<meta property="og:description" content="" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://damon-kwok.github.io/pony-tutorial/404.html" />

<meta itemprop="name" content="404 Page not found">
<meta itemprop="description" content=""><meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="404 Page not found"/>
<meta name="twitter:description" content=""/>

  </head>

  <body class="ma0 avenir bg-near-white">

    

  <header>
    <div class="bg-pony-brown">
      <nav class="pv3 ph3 ph4-ns" role="navigation">
  <div class="flex-l justify-between items-center center">
    <a href="https://damon-kwok.github.io/pony-tutorial/" class="f3 fw2 hover-white no-underline white-90 dib">
      Pony 教程
    </a>
    <div class="flex-l items-center">
      
      
<div hidden>
  <span id="new-window-0">Opens in a new window</span>
  <span id="new-window-1">Opens an external site</span>
  <span id="new-window-2">Opens an external site in a new window</span>
</div>



<a href="https://www.twitter.com/ponylang" target="_blank" class="link-transition twitter link dib z-999 pt3 pt0-l mr1" title="Twitter link" rel="noopener" aria-describedby="new-window-0">
  <svg height="32px"  style="enable-background:new 0 0 67 67;" version="1.1" viewBox="0 0 67 67" width="32px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M37.167,22.283c-2.619,0.953-4.274,3.411-4.086,6.101  l0.063,1.038l-1.048-0.127c-3.813-0.487-7.145-2.139-9.974-4.915l-1.383-1.377l-0.356,1.017c-0.754,2.267-0.272,4.661,1.299,6.271  c0.838,0.89,0.649,1.017-0.796,0.487c-0.503-0.169-0.943-0.296-0.985-0.233c-0.146,0.149,0.356,2.076,0.754,2.839  c0.545,1.06,1.655,2.097,2.871,2.712l1.027,0.487l-1.215,0.021c-1.173,0-1.215,0.021-1.089,0.467  c0.419,1.377,2.074,2.839,3.918,3.475l1.299,0.444l-1.131,0.678c-1.676,0.976-3.646,1.526-5.616,1.568  C19.775,43.256,19,43.341,19,43.405c0,0.211,2.557,1.397,4.044,1.864c4.463,1.377,9.765,0.783,13.746-1.568  c2.829-1.673,5.657-5,6.978-8.221c0.713-1.716,1.425-4.851,1.425-6.354c0-0.975,0.063-1.102,1.236-2.267  c0.692-0.678,1.341-1.419,1.467-1.631c0.21-0.403,0.188-0.403-0.88-0.043c-1.781,0.636-2.033,0.551-1.152-0.402  c0.649-0.678,1.425-1.907,1.425-2.267c0-0.063-0.314,0.042-0.671,0.233c-0.377,0.212-1.215,0.53-1.844,0.72l-1.131,0.361l-1.027-0.7  c-0.566-0.381-1.361-0.805-1.781-0.932C39.766,21.902,38.131,21.944,37.167,22.283z M33,64C16.432,64,3,50.569,3,34S16.432,4,33,4  s30,13.431,30,30S49.568,64,33,64z" style="fill-rule:evenodd;clip-rule:evenodd;fill:;"/></svg>

<span class="new-window"><svg  height="8px"  style="enable-background:new 0 0 1000 1000;" version="1.1" viewBox="0 0 1000 1000" width="8px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
<path d="M598 128h298v298h-86v-152l-418 418-60-60 418-418h-152v-86zM810 810v-298h86v298c0 46-40 86-86 86h-596c-48 0-86-40-86-86v-596c0-46 38-86 86-86h298v86h-298v596h596z" style="fill-rule:evenodd;clip-rule:evenodd;fill:;"/>
</svg>
</span></a>





<a href="https://github.com/damon-kwok/pony-tutorial-zh_CN" target="_blank" class="link-transition github link dib z-999 pt3 pt0-l mr1" title="Github link" rel="noopener" aria-describedby="new-window-0">
  <svg  height="32px"  style="enable-background:new 0 0 512 512;" version="1.1" viewBox="0 0 512 512" width="32px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
  <path d="M256,32C132.3,32,32,134.8,32,261.7c0,101.5,64.2,187.5,153.2,217.9c11.2,2.1,15.3-5,15.3-11.1   c0-5.5-0.2-19.9-0.3-39.1c-62.3,13.9-75.5-30.8-75.5-30.8c-10.2-26.5-24.9-33.6-24.9-33.6c-20.3-14.3,1.5-14,1.5-14   c22.5,1.6,34.3,23.7,34.3,23.7c20,35.1,52.4,25,65.2,19.1c2-14.8,7.8-25,14.2-30.7c-49.7-5.8-102-25.5-102-113.5   c0-25.1,8.7-45.6,23-61.6c-2.3-5.8-10-29.2,2.2-60.8c0,0,18.8-6.2,61.6,23.5c17.9-5.1,37-7.6,56.1-7.7c19,0.1,38.2,2.6,56.1,7.7   c42.8-29.7,61.5-23.5,61.5-23.5c12.2,31.6,4.5,55,2.2,60.8c14.3,16.1,23,36.6,23,61.6c0,88.2-52.4,107.6-102.3,113.3   c8,7.1,15.2,21.1,15.2,42.5c0,30.7-0.3,55.5-0.3,63c0,6.1,4,13.3,15.4,11C415.9,449.1,480,363.1,480,261.7   C480,134.8,379.7,32,256,32z"/>
</svg>

<span class="new-window"><svg  height="8px"  style="enable-background:new 0 0 1000 1000;" version="1.1" viewBox="0 0 1000 1000" width="8px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" >
<path d="M598 128h298v298h-86v-152l-418 418-60-60 418-418h-152v-86zM810 810v-298h86v298c0 46-40 86-86 86h-596c-48 0-86-40-86-86v-596c0-46 38-86 86-86h298v86h-298v596h596z" style="fill-rule:evenodd;clip-rule:evenodd;fill:;"/>
</svg>
</span></a>



    </div>
  </div>
</nav>

    </div>
  </header>


    <main role="main">
      
    <article class="center cf pv5 measure-wide-l">
      <h1>
        This is not the page you were looking for
      </h1>
    </article>

    </main>
    

<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/highlight.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.6/languages/pony.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>

<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/lunr.js/2.3.5/lunr.min.js"></script>

<script async defer src="https://buttons.github.io/buttons.js"></script>

<script>
  var toggleBtns = document.getElementsByClassName('js-toggle')
  for (var i = 0; i < toggleBtns.length; i++) {
    toggleBtns[i].addEventListener('click', toggleClass, false)
  }

  var myToggleBtns = document.getElementsByClassName('hide-show-toggle')
  for (var i = 0; i < myToggleBtns.length; i++) {
    myToggleBtns[i].addEventListener('click', hideShow, false)
  }

function hideShowDM() {
  var menu = document.getElementById("doc-menu")
  var thebody = document.getElementById("the-body")
  if (window.getComputedStyle(menu).display == "none") {
    menu.style.display = "block";
    thebody.style.left = "300px";
  } else {
    menu.style.display = "none";
    thebody.style.left = "0px";
  }
}

function hideShowCM() {
  var menu = document.getElementById("context-menu")
  if (window.getComputedStyle(menu).display == "none") {
    menu.style.display = "block";
  } else {
    menu.style.display = "none";
  }
}

function toggleClass() {
  
  var content = this.dataset.target.split(' ')
  
  var mobileCurrentlyOpen = document.querySelector('.mobilemenu:not(.dn)')
  var desktopCurrentlyOpen = document.querySelector('.desktopmenu:not(.dn)')
  var desktopActive = document.querySelector('.desktopmenu:not(.dn)')

  
  for (var i = 0; i < content.length; i++) {
    var matches = document.querySelectorAll(content[i]);
    
    [].forEach.call(matches, function(dom) {
        dom.classList.contains('dn') ?
        dom.classList.remove('dn') :
        dom.classList.add('dn');
         return false;
       });
        
      if (mobileCurrentlyOpen) mobileCurrentlyOpen.classList.add('dn')
      if (desktopCurrentlyOpen) desktopCurrentlyOpen.classList.add('dn')
      if (desktopActive) desktopActive.classList.remove('db')

    }
  }

var Pony = {};


Pony.Search = (function() {
  var that = {}
  that.lunrIndex = undefined;
  that.pages = [];

  that.doSearch = function(query) {
    var resultsContainer = $('#search-results');
    var contentContainer = $('#content');
    
    var results = this.lunrIndex.search(query).map(function(result) {
      
        return {
            page: that.pages[result.ref],
            metadata: result.matchData.metadata
        };
    });

    
    resultsContainer.empty();
    resultsContainer.append(
        $("<header>", {class: "mt4 w-100"}).append(
            $("<p>", {class: "f6 b helvetica tracked", text: "SEARCH RESULTS"}))
    );
    var resList = $("<ul>", {id: "search-result-list"});

    
    results.slice(0, 100).forEach(function(result) {
        var res = $("<li>");
        var div = $("<div>", {class: "search-result"});
        div.append($("<a>", {
          href: result.page.uri,
          text: result.page.title,
          class: "search-result-title"
        }));
        var p = $("<p>", {
            class: "search-result-summary"
        });
        var highlighted = that.highlightResult(result.page.summary, result.metadata);
        p.append(highlighted);
        div.append(p);
        res.append(div);
        resList.append(res);
    });
    resultsContainer.append(resList);

    
    contentContainer.addClass("dn");
    resultsContainer.removeClass("dn");
  };

  that.highlightResult = function(text, metadata) {
      var span = $("<span>");
      for (var key in metadata) {
        var summary_metadata = metadata[key]["summary"];
        if (summary_metadata !== undefined && summary_metadata["position"] !== undefined) {
            var position_metadata = summary_metadata["position"];
            var last_pos = 0;
            summary_metadata["position"].forEach(function(elem) {
                span.append(
                    $("<span>", {text: text.slice(last_pos, elem[0])})
                );
                span.append(
                    $("<span>", {
                        class: "highlighted",
                        text: text.slice(elem[0], elem[0] + elem[1])})
                );
                last_pos = elem[0] + elem[1];
            });
            span.append(
                $("<span>", {text: text.slice(last_pos, text.length)})
            );
        } else {
          span.text(text);
        }
      }
      return span;
  };

  that.initLunr = function(onSuccess) {
      $.getJSON("/index.json")
        .done(function(index) {
           
           that.pages = index;
           that.lunrIndex = lunr(function() {
             this.metadataWhitelist = ['position']; 
             this.field("title", { boost: 10 });
             this.field("tags", { boost: 5 });
             this.field("categories", { boost: 5 });
             this.field("content");
             this.field("summary", {boost: 0});
             this.ref("i");

             index.forEach(function (page, idx) {
                 page["i"] = idx;
                 this.add(page)
               },
               this
             );
           });
           onSuccess();
        })
        .fail(function(jqxhr, textStatus, error) {
          var err = textStatus + ", " + error;
          console.error("Error getting search index file:", err);
        });
    }
  that.setUpSearchUI = function() {
    $('#search-box').keyup(function() {
        var query = $(this).val();
        if (query.length < 2) {
            if (query.length == 0) {
                $('#content').removeClass('dn');
                $('#search-results').empty().addClass('dn');
            }
            return;
        }
        if (that.lunrIndex === undefined) {
            that.initLunr(function () {
              that.doSearch(query);
            });
        } else {
            that.doSearch(query);
        }
    });
  }
  return that;
})();




$(document).ready(function() {
  Pony.Search.setUpSearchUI();
});
</script>

  </body>
</html>
